<?php

namespace App\Repositories;

use App\Models\Cooperation;
use InfyOm\Generator\Common\BaseRepository as iBaseRepository;

class CooperationRepository extends iBaseRepository
{
    /**
     * @var array
     */
    protected $fieldSearchable = [
        'channel_id',
        'item_id',
        'status'
    ];

    /**
     * Configure the Model
     **/
    public function model()
    {
        return Cooperation::class;
    }

    public function getByChannelIdAndItemId($channelId, $itemId)
    {
        return $this->model->where(['channel_id' => $channelId, 'item_id' => $itemId])->first();
    }
}
